home *** CD-ROM | disk | FTP | other *** search
- Ã…rhus 28. August 1999.
-
-
- This program will convert a simple 8bit ascii textfile into a htmlfile.
- The result is a 'preformatted' 7 bit htmlfile. The textfile may use a 8-
- bit Atari charset or 8 bit iso-8859-1 charset.
-
- A2html is written by Tommy Andersen <tommya@post3.tele.dk>. It is PD,
- anybody (that's you) may use it or even sell it. Distribution is allowed
- and you may put the package on your website, in shareware programs and
- other obscure locations.
-
- Feel free to email bugreports, patches or idea's. Thanx to many people for
- feed backs. My mailbox has no limits, so don't be afraid to send very
- large emails.
-
- -----------------------------------
-
- Installation:
- -------------
-
- Unpack the zipfile. A2html can be used immediately, but to use the package
- better, follow one or more of these steps:
-
- Atari desktop users would drag a2html.ttp to the desktop (textfiles can
- later be dropped on that icon).
-
- Mufpel users could copy a2html.ttp to c:\bin, and a2html.0 to the cat1
- pages in C:\gemini2\man\cat1 - and rename a2html.0 to a2html.1.
-
- MiNT users may do the same as the desktop users, but are likely to copy
- a2html.ttp to /usr/local/bin, rename a2html.ttp to a2html, "chmod +x
- a2html", and copy a2html.1 to /usr/local/man/man1. To use a2html (without
- .ttp filetype) on the desktop, they may have to "ln -s a2html a2html.ttp"
- and drag a2html.ttp to the desktop.
-
- Linux people may copy a2html.1 to /usr/local/man/man1, compile a2html and
- copy a2html to /usr/local/bin.
-
-
- Files
- -----
-
- a2html-0.81/ (Top directory - 0.81 is the version)
- a2html.ttp A2html (Atari TTP program)
- docs/
- readme.txt You're reading it
- charset.txt Some charset tables (Atari)
- a2html.1 Manpage for unix
- a2html.0 Ascii preformatted manpage
- a2htmlrc Example of an initialization file
- source/
- a2html.c The C-source of a2html
- makefile.lcc Makefile for Lattice C-Compiler (Atari)
- makefile.gcc Makefile for GCC (Atari)
- makefile.lnx Makefile for GCC (Linux)
- changelog List of changes in the sources.
-
-
- Normal use:
- -----------
-
- You can start a2html from your favourite shell or directly from the
- desktop.
-
- From desktop:
-
- Doubleclick a2html.ttp and enter a filename (complete path!) and a
- htmlfile will be created in the same directory on your disk.
-
- Or drag 'n drop some textfiles on a2html and multiple textfiles can be
- converted at once. Filenames with space(s) can not be converted in
- this way with a stu<mumble mumble> simple desktop, but smart desktops
- can do it.
-
- The dropped textfiles will be converted into htmlfiles, with the same
- name as the source, but with a html filetype. Existing htmlfiles with
- same name will be deleted and overwritten with no warnings.
-
-
- From a shell, you may enter the name of the program and some filenames.
- Examples:
-
- $a2html my.txt
- will make "my.html".
-
- $a2html one.txt two.txt three.txt
- will make "one.html" "two.html" "three.html"
-
- $a2html one.txt -o result.html
- will make "result.html" from one.txt
-
- $a2html one.txt -o a.html two.txt -o b.html
- will make "a.html" from one.txt and "b.html" from two.txt.
-
- $a2html *.txt
- will convert all txt files in current directory. Your shell (not
- a2html) will expand *.txt to real filenames.
-
- $ls | a2html
- will produce a html listning on your screen.
-
- $ls | a2html -o list.html
- will send it all down to "list.html"
-
- $a2html one.txt -
- will send the result from the textfile one.txt to your screen
-
- $a2html one.txt - | program
- will pipe the result from the textfile one.txt to your program
-
- $ls | a2html - | program
- will make a2html act as a filter. You may use some switches to omit
- the predefined headers.
-
- $man gcc | col -bx | a2html -o gcc.html
- will make a html man-page for your GCC compiler.
-
- $find ./ -name '*.txt' -exec a2html {} \;
- will make a recursive search and convert all textfiles to html.
-
-
- Table 1 in the file "charset.txt" lists all charaters that will be
- converted. Atari users using the standard system font or GDOS, are using
- the Atari charset. Table 2 displays 8 bit Atari characters and the iso-
- 8859-1 name.
-
- First, every char from the textfile are converted from the Atari charset
- (8-bit) to the iso-8859-1 (8-bit) charset. Secondly, it will be converted
- to a html (7-bit) syntax.
-
- If you are using an iso-8859-1 font as the system font look in the next
- section.
-
- Characters not found in the iso-8859-1 charset will be replaced with a
- space.
-
- The Atari charset is default if running a2html on an Atari. If a2html was
- compiled on Linux, the iso-8859-1 charset is default.
-
- Special use:
- ------------
- If you created your document with an iso-8859-1 charset/font, enter:
-
- $a2html -iso-8859-1 mytext.txt on the commandline
-
- The '-iso-8859-1' option tells a2html, that the file already uses a 8 bit
- iso-8859-1 charset. All characters can and will be converted into 7 bit
- html syntax.
-
- Strange things
- --------------
-
- Syntax is:
-
- a2html -option textfile -o htmlfile
-
- The textfile is the inputfile, the htmlfile is the outputfile. Not
- recognized options will be used as a textfile. Read "-p, -pause" as
- "-p" or "-pause".
-
- Options:
-
- -p, -pause
- The program waits for a keypress (Return) before it terminates.
-
- -q, -quiet
- The program will not display errors on screen.
-
- -dumpargs
- Dumps all arguments on stderr. Could be used to validate the ARGV
- function.
-
- --help Lists all valid options to a2html. If a pause is required, use -p
- before --help.
-
- --version
- Prints version of a2html.
-
- -crlf Now.. Default is to use a single LF to finish a line. Use this
- switch if you want a CR too. It does not matter how the lines
- are finished in the textfile, they will always be LF or CRLF
- terminated.
-
- -iso, -iso-8859-1
- Textfile uses an iso-8859-1 charset.
-
- -atari Textfile uses an Atari charset.
-
- -notags The htmlfile does not have <html>, <head>, doctype tags. You can
- paste or merge the file into an existing htmlfile. Links will
- still be created.
-
- -nopre Omit <pre> </pre> tags. The resulting htmlcode may look ugly in
- your browser.
-
- -nobr -nopre (see above) will terminate all lines with <br>. Use -nobr
- to omit <br>.
-
- -nolinks Don't make links from for url's in textfile.
-
- -nomail Don't make mailto's from anything that looks like an emailaddress.
-
- -nodoctype
- Don't output the W3C document type definition (3.2) in the
- beginning of the htmlfile.
-
- -footer <string>
- Outputs the string after the last </pre> and just before </body>.
- String will not be charset parsed, and links will not be created.
- The string may have linefeeds and tags. Using quotes in the
- string and newlines (from a shell) could be a problem, however
- not from a calling (GEM) program.
-
- -o <htmlfile>, -out <htmlfile>
- Write output to htmlfile.
- With no "-o htmlfile" option, a2html will look at the name of the
- previous textfile and change it to a html filetype.
-
- -, -stdout
- Force output (the htmlcode) to standard output.
-
- -title <string>
- Changes the html document title for the current htmlfile. More
- titles are allowed in one session, but a title applies only to
- the current textfile. Use "" when a2html is started from a shell.
- The title will be charset parsed, so you can use 8 bit characters.
-
- -emailsource
- a2html reads the textfile as an email and will only display Date,
- From, Reply-To, To, Cc and Subject fields. However, a2html will
- not convert quoted-printable nor mime-encoded emails. These will
- be displayed as they look (in the bodytext). When this option is
- invoked, a2html will change default charset to iso-8859-1. The
- complete header is hidden in comments, just select "view source"
- in your browser.
-
- -separator <string>
- Outputs the string between the header and body text. String must
- be valid htmlcode and will not be charset parsed.
- Example: -separator "<hr>"
-
- -bodybgcolor <color>
- Changes the default background color white to <color>.
-
- -bodytext <color>
- Changes the default text color black to <color>.
-
- -bodylink <color>
- Changes the default link color blue to <color>.
-
- No textfile
- a2html will read input from standard input.
-
-
- Using a2htmlrc
- --------------
-
- a2html will look for a2htmlrc (and .a2htmlrc) in current working directory
- and in your home directory. The home directory is found with the HOME
- environment variable. If an a2htmlrc file is found, it will be used before
- the options on the commandline. Only one a2htmlrc file is read.
-
- You can find an example of an a2htmlrc file in the docs directory, with
- all a2htmlrc options listed.
-
- When a2html is started from the desktop (drag'drop), it will properly not
- find the a2htmlrc file! Most desktop shells will set the current working
- directory (cwd) to the directory with a2html.ttp, and not to where the
- textfiles are. However, some desktops will let you "install" a2html, and
- you may get the choice of setting the directory to the right one.
-
-
- Compiling a2html
- ----------------
-
- a2html can be compiled with GCC (MiNT/MagiC or Linux) and Lattice C.
-
- Lattice C: Enter "make -f makefile.lcc"
- Note that I never use the projectmanager, but always gnu make.
- You will also need mintbind.h, so a2html can go into the MiNT
- domain (long filenames on MiNT and MagiC) with Pdomain().
-
- GCC 2.8.1: You can compile a2html with this commandline from tsch or your
- favorite shell (commandline wrapped):
- gcc -O2 -fomit-frame-pointer -m68000 -mshort -DATARI
- a2html.c -o a2html.ttp
- or simply:
- make -f makefile.gcc
-
- Linux: Just enter "make -f makefile.lnx"
-
- Other: Well, try compile it. Take care of the stdin/stdout
- translation, it must be done in binary mode (LF not converted
- to LF+CR). You should use a ANSI-style compiler with a ANSI-
- type C-library.
-
-
- Final notes:
- ------------
-
- 0.1 -> 0.2 Doctype changed from HTML 3.2 to HTML 2.0. W3C forgot the
- " in the HTML 3.2 DTD, and the result was a huge
- errorlist from "A Kinder, Gentler HTML Validator", see
- "http://ugweb.cs.ualberta.ca/~gerald/validate/". No
- problems when a HTML 2.0 doctype is used.
-
- 0.2 -> 0.3 Runs on Linux 68k. Type 'make -f makefile.lnx' and copy
- a2html to /usr/local/bin
- If no inputfile then a2html will read from stdin. You can
- now pipe text in and pipe result into another program.
-
- 0.3 -> 0.4 Major rewrite. Links like http://home3.inet.tele.dk/tommya will
- be tagged with <a href="....">link</a>. Some checks are made,
- and if your links just doesn't appear as a link, the link could
- be broken. These url types are being checked: ftp, http, file,
- news, wais, nntp, imap, https, telnet, mailto and gopher. If
- you don't like a2html to make these links, just enter
- -nolinks on the commandline.
-
- Well, coded a email checker into a2html too. If a2html meets
- something like user@host, it will make a mailto link. And if
- you don't like that either, enter -nomail on the commandline.
-
- Possible to specify a outputfile, if you want a2html to use
- that, you must enter an inputfile.
-
- If you enter an inputfile, but (no) outputfile, a2html will
- write output to a2html.html.
-
- If a2html couldn't make the html file, it will return 1.
-
- 0.4 -> 0.5 Bug found and fixed. Look at the sourcecode for more
- informations on that.
-
- a2html will try to save the output in a file with the same name
- as the inputfile, but with the extension (filetype) changed to
- html. It will never save anything to a2html.html anymore. That
- is, the input file isn't called a2html ;-)
-
- If you enter an illegal switch on the commandline, it would be
- taken as a filename. It still does that, but since that
- filename (switch) doesn't exist, it won't delete your inputfile
- (it would be taken as an outputfile).
-
- A new switch -nopre removes <pre> </pre> from the outputfile.
- However, the html file could now be interpreted as one big
- line, so <br> are inserted at the very end at each line.
- Doublespaces, spaces at the beginning of a line etc will vanish
- in your browser (html rule). It looks a little bit ugly at the
- moment. If you don't like the <br>, enter -nobr on the
- commandline.
-
- Url's like <url:http://home3.inet.tele.dk/tommya/> are now
- recognized too. See RFC1738 for more information.
-
- 0.5 -> 0.6 Url's like (http://host/path) will not include the ( ) in the
- link (highlighted part). Same story with (tommya@post3.tele.dk).
- <wrong:http//host/> are recognized as an invalid url. Prospero
- url type included.
-
- 0.6 -> 0.7 Another bug found. Second time this happens :( Only when -iso
- mode was used, and a 8-bit characters was converted. Fixed.
- End tags in proper order.
- " changed to ". If you are validating a html 3.2
- document with a2html generated body text (copy and pasted to
- your document), the " would produce some errors.
- W3C Validator Services: http://validator.w3.org/.
-
- Well, compiled MiNTLib pl48 for the good old Lattice Compiler,
- but the Lattice binary is only 5K smaller than the GCC binary,
- so next versions of a2html will be compiled with GCC.
-
- Major changes in commandline parsing. Multiple inputfiles at
- once is possible.
-
- All switches are global, that is, you can not convert a -atari
- and a -iso file at the same time and get the right result.
-
- 0.7 -> 0.8 Man-page created. Corrected the documentation.
- Just added a extra check for very long words. MiNTLib pl49 is
- used now.
- Bug fixed - if last argument was '-o' then a2html would crash :(
- Another one fixed - could take place in very rare situations.
-
- New option, -title "string" will change title. Title will be
- changed for current outputfile (or inputfile). Example from
- your shell:
- $a2html one.txt -title "File no. 1" two.txt -title "File no. 2"
-
- Title will always be parsed into 7bit html syntax.
-
- New options: -nodoctype, -footer "html-code"
- New option: -emailsource and -separator "html-code"
-
- New options -bodybgcolor <color> -bodytext <color> and -
- bodylink <color>.
-
- Html 3.2 doc header.
-
- Well, the sources are now under rcs control, and a new
- distribution can be made in 20 sec (some smart scripts used).
- If any files are missing then blame it on my smart scripts.
-
- --version added, -quiet, -pause, -iso-8859-1 can also be used.
-
- Usage should be more friendly, and this readme text should now
- have a better consistency.
-
- Fixed some backrunning pointers.
-
- a2html will now look for an a2htmlrc file.
-
- Checks a2htmlrc variables for overrun. Man page updated.
-
- 0.8 -> No Home environment variable bug fixed (2 bombs!).
-
- Oh... just use it and enjoy :-)
-
- CU
-
- Tommy Andersen
-